import request from '@/utils/request'

// 订单列表查询
export function fetchOrderList(query) {
  return request({
    url: '/order/order/list',
    method: 'get',
    params: query
  })
}

//修改地址
export function updateAddress(data) {
  return request({
    url: '/order/order/updAddress',
    method: 'put',
    data: data
  })
}

// 订单详情
export function fetchOrderDetail(id) {
  return request({
    url: `/order/order/detail/${id}`,
    method: 'get'
  })
}

//修改价格
export function updatePrice(data) {
  return request({
    url: '/order/order/changePrice',
    method: 'post',
    data: data
  })
}

// 删除订单（支持单删和批删）
export function deleteOrders(ids) {
  return request({
    url: '/order/order/delete',
    method: 'delete',
    data: ids
  })
}

// 导出订单
export function exportOrderList(params) {
  return request({
    url: '/order/order/export',
    method: 'get',
    params,
    responseType: 'blob'
  })
}
